package com.smartEdu.commons.enums;

public enum HomeWorkStatusEnum {
	ALL("0","全部"),
	NORELEASE("1","未发布"),
	RELEASING("2","发布中"),
	END("3","已结束"),
	COMPLETE("4","发布中");
	
	private String code;
	private String name;
	
	private HomeWorkStatusEnum(String code, String name) {
		this.name = name;
		this.code = code;
	}

	public String getCode() {
		return code;
	}

	public String getName() {
		return name;
	}
	
	public static String getName(String code){
		if (code == null) {
			return "";
		}
		for(HomeWorkStatusEnum enums : HomeWorkStatusEnum.values()){
			if (enums.getCode().equals(code)) {
				return enums.getName();
			}
		}
		return code;
	}
}
